unit MainForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  /// <summary>
  /// Example form.
  /// </summary>
  TMainFrm = class(TForm)
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  MainFrm: TMainFrm;

implementation

uses
  // Generics.Collections,
  GenericCollections;

{$R *.dfm}

procedure TMainFrm.Button1Click(Sender: TObject);
begin
  // zmena Ahoj->Nazdar
  ShowMessage('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA a zaroven B');
end;

procedure TMainFrm.FormCreate(Sender: TObject);
var
  List: IList<string>;
  I: Integer;
begin
  List := TList<string>.Create;
  try
    List.Add('abc');
    List.Add('xyz');

    for I := 0 to List.Count - 1 do
    begin
      Self.Caption := TrimLeft(Self.Caption + ' ' + List[I]);
    end;

  finally
    // List.Free; !List is interface
  end;
end;

end.
